<template>
  <div class="Mypet">
    <!-- 头部上传头像 -->
    <div class="Mypet_header" @click="goToProfile">
      <div class="user">
        <span class="iconfont icon-user"></span>
        <p class="user_name">Your Name</p>
      </div>

      <span class="iconfont icon-arrow-drop-right-line"></span>
    </div>
    <!--  My Pets 添加宠物入口 -->
    <div class="Mypet_entrance_container">
      <!-- 左边入口 -->
      <div class="Mypet_entrance">
        <h3 class="Mypet_entrance_title">My Pets</h3>
        <!-- 入口 -->
        <div class="Mypet_entrance_item">
          <!-- 添加 -->
          <div class="Mypet_entrance_item_add">
            <span class="iconfont icon-yijianfankui"></span>
          </div>
          <p class="Mypet_entrance_item_text">Add Pet</p>
        </div>
      </div>
      <!-- 右侧添加 -->
      <div class="Mypet_Right_add">
        <span class="iconfont icon-yijianfankui"></span>
      </div>
    </div>
    <!-- My Order -->
    <div class="Mypet_Order">
      <div class="Mypet_Order_hd">
        <p class="Mypet_Order_hd_text">My Order</p>
        <div class="Mypet_Order_hd_All">
          <span class="All">All</span>
          <span class="iconfont icon-arrow-drop-right-line"></span>
        </div>
      </div>
      <div class="Mypet_Order_bd">
        <!-- 数量 -->
        <div class="quantity">0</div>
        <!-- Awaiting Use  等待使用 -->
        <div class="Awaiting">Awaiting Use</div>
      </div>
    </div>
    <!-- Coupon & Discount -->
    <div class="Mypet_discount">
      <div class="Mypet_discount_l">
        <img :src="couponIcon" alt="" />
        <span>Coupon & Discount</span>
      </div>
      <div class="Mypet_discount_r">
        <span class="num">7</span>
        <span class="iconfont icon-arrow-drop-right-line"></span>
      </div>
    </div>
    <!-- 配置 -->
    <div class="configuration">
      <!-- 设置 -->
      <div class="Mypet_setting">
        <div class="left">
          <span class="iconfont icon-a-shezhi-shucaidanshezhi-copy"></span>
          <p>Settings</p>
        </div>
        <span class="iconfont icon-arrow-drop-right-line"></span>
      </div>
      <!-- 反馈 -->
      <div class="Mypet_feedback">
        <div class="left">
          <span class="iconfont icon-fankui"></span>
          <p>Feedback</p>
        </div>
        <span class="iconfont icon-arrow-drop-right-line"></span>
      </div>
    </div>
  </div>
</template>
 
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const couponIcon = new URL("../assets/Coupon.png", import.meta.url).href;

const goToProfile = () => {
  router.push({
    path: "/MyPet/Profile", // 使用完整路径
  });
};
</script>

<style lang="scss" scoped>
.Mypet {
  padding: 15px;
  .Mypet_header {
    background-color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 6px 15px 15px;
    position: relative;

    .user {
      height: 40px;
      color: #ced9de;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .icon-user {
        width: 35px;
        height: 35px;
        color: #b1c0c9;
        font-size: 25px;
        background-color: #cfdadf;
        border-radius: 50%;
        margin-right: 5px;
        display: flex;
        justify-content: center;
        align-items: end;
      }
      .user_name {
        color: #000;
        font-weight: bold;
        font-size: 15px;
      }
    }
  }
  .Mypet_entrance_container {
    height: 178px;
    border-radius: 10px;
    background-color: #bbf7ee;
    margin-top: 15px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    .Mypet_entrance {
      .Mypet_entrance_title {
        font-size: 18px;
      }
      .Mypet_entrance_item {
        width: 100px;
        height: 100px;
        background-color: #fff;
        border-radius: 10px;
        position: relative;
        margin-top: 5px;
        display: flex;
        justify-content: center;
        align-items: center;
        .Mypet_entrance_item_add {
          width: 45px;
          height: 45px;
          border: 2px dashed #1cb791;
          border-radius: 10px;
          display: flex;
          justify-content: center;
          align-items: center;
          .icon-yijianfankui {
            font-size: 18px;
            color: #1eb694;
            font-weight: bold;
          }
        }
        .Mypet_entrance_item_text {
          width: 100%;
          position: absolute;
          bottom: -25px;
          left: 50%;
          transform: translateX(-50%);
          font-weight: bold;
          font-size: 14px;
          text-align: center;
        }
      }
    }
    .Mypet_Right_add {
      width: 30px;
      height: 30px;
      background-color: #19b693;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      .icon-yijianfankui {
        font-size: 14px;
        color: #fff;
        font-weight: bold;
      }
    }
  }
  .icon-arrow-drop-right-line {
    position: absolute;
    font-size: 25px;
    color: #8c8e93;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
  .Mypet_Order {
    border-radius: 10px;
    background-color: #fff;
    padding: 10px;
    margin-top: 15px;
    .Mypet_Order_hd {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 14px;
      margin-right: -6px;
      margin-bottom: 6px;
      .Mypet_Order_hd_text {
        font-weight: bold;
      }
      .Mypet_Order_hd_All {
        width: 32px;
        position: relative;
        font-size: 12px;
      }
    }
    .Mypet_Order_bd {
      height: 70px;
      border-radius: 5px;
      background-color: #eaeff9;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .quantity {
        font-weight: bold;
        font-size: 20px;
      }
    }
  }
  .Mypet_discount {
    position: relative;
    background-color: #fff;
    border-radius: 10px;
    padding: 0 10px;
    margin-top: 10px;
    height: 45px;
    font-size: 15px;
    font-weight: 460;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .Mypet_discount_l {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: bold;
      img {
        width: 20px;
        margin-right: 5px;
        vertical-align: bottom;
      }
    }
    .Mypet_discount_r {
      .num {
        display: inline-block;
        width: 20px;
        font-weight: bold;
      }
    }
  }
  .configuration {
    background-color: #fff;
    border-radius: 10px;
    margin-top: 10px;
    .Mypet_setting,
    .Mypet_feedback {
      position: relative;
      padding: 10px 12px;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .left {
        display: flex;
        .iconfont {
          margin-right: 10px;
          width: 25px;
          height: 25px;
          background-color: #eaeff9;
          display: flex;
          justify-content: center;
          align-items: center;
          border-radius: 5px;
        }
      }
    }
    .Mypet_setting {
      border-bottom: 1px solid #f7f7f7;
      .icon-a-shezhi-shucaidanshezhi-copy {
        color: #7f8db1;
      }
    }
    .Mypet_feedback {
      .icon-fankui {
        color: #5c8efe;
        background-color: #c7d7f9 !important;
      }
    }
  }
}
</style>